package com.sx.gongzhong.adapter;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.sx.gongzhong.R;
import com.sx.gongzhong.model.EntranceBean;
import com.zhy.adapter.abslistview.CommonAdapter;
import com.zhy.adapter.abslistview.ViewHolder;

import java.util.List;

/**
 * Created by admin on 2017/12/28.
 */

public class MainPageEntranceAdapter extends CommonAdapter<EntranceBean> {


    private Context context;

    public MainPageEntranceAdapter(Context context, int layoutId, List<EntranceBean> datas) {
        super(context, layoutId, datas);
        this.context=context;
    }


    @Override
    protected void convert(ViewHolder viewHolder, final EntranceBean item, int position) {
        ImageView imageView = viewHolder.getView(R.id.icon_entrance);
        TextView textView = viewHolder.getView(R.id.entrance_name);
        Glide.with(context).load(item.icon).into(imageView);
        textView.setText(item.name);
    }
}
